* Replication files for The Contingent Character of Interest Group-Political Party Interactions
* March 2020
* Corresponding author Camilo.Cristancho@ub.edu

* load data
cd ""
use "IG_parties_dyads_replication_JPP.dta"

set scheme plotplain

* Figure 1. Number of parties contacted
hist nparties


* Table 1. Descriptive statistics
tabstat contact ppdum psoedum iudum csdum psdum ciudum pnvdum ///
economicgroup age budgetnumber, statistics(n min max mean sd)
tabstat seats lrecon, by(party)


* Table 2. Contact by issue salience, mainstream status and resources
foreach var in mainstream seats mip budgetnumber {
logit contact `var', cl(org_id)
margins, dydx(*) post
est sto _m`var'
}

logit contact mainstream mip budgetnumber type3 age lrecon, cl(org_id)
margins, dydx(*) post
est sto _mall1

logit contact seats mip budgetnumber type3 age lrecon, cl(org_id)
margins, dydx(*) post
est sto _mall2

esttab _m*,  b(%9.3f) se(%9.3f) pr2(%9.3f) r2(%9.3f)


* Figure 2. Number of parties that interest groups seek access to by issue salience Original dataset - non-dyad
collapse nparties mip, by(macrocode)
twoway (scatter nparties mip, mlabel(macrocode))


* Figure 3. Predictive Margins of Interest Group Type
logit contact mainstream mip budgetnumber age type3##c.lrecon, cl(org_id)
margins type3, at(lrecon=(0(1)10))
marginsplot, noci